﻿Public Class frmUsuariosVer

    Private mMantenimientoBE As BE.Usuarios
    Private mMantenimientoBS As BS.Usuarios
    Private mId As Integer

    Public Property Id As Integer
        Get
            Return mId
        End Get
        Set(ByVal value As Integer)
            mId = value
        End Set
    End Property

    Private Sub frmUsuariosVer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        mMantenimientoBS = New BS.Usuarios
        mMantenimientoBE = mMantenimientoBS.Obtener(Me.Id)

        txtNombreCompleto.Text = mMantenimientoBE.NombreCompleto
        txtIdentificacion.Text = mMantenimientoBE.Identificacion
        txtNombreUsuario.Text = mMantenimientoBE.NombreUsuario
        txtContrasena.Text = mMantenimientoBE.Contrasena

        If mMantenimientoBE.PerfilUsuario = BE.PerfilUsuario.Administrador Then
            rbAdministrador.Checked = True
        Else
            rbCajero.Checked = True
        End If
        If mMantenimientoBE.Estado = BE.Estado.Habilitado Then
            rbHabilitado.Checked = True
        Else
            rbInhabilitado.Checked = True
        End If

        txtNombreCompleto.Enabled = False
        txtIdentificacion.Enabled = False
        txtNombreUsuario.Enabled = False
        txtContrasena.Enabled = False
        rbAdministrador.Enabled = False
        rbCajero.Enabled = False
        rbHabilitado.Enabled = False
        rbInhabilitado.Enabled = False

    End Sub

    Private Sub btnCerrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCerrar.Click
        Me.DialogResult = Windows.Forms.DialogResult.Cancel
    End Sub
End Class